#ifndef __TCPCLIENT_H__
#define __TCPCLIENT_H__

#include <iostream>
#include <sys/socket.h>
#include <cstring>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>


using namespace std;

class tcpClient{
private:
    int m_clientfd;
    string m_ip;
    unsigned short m_port;
public:
    tcpClient();
    bool connect(const string& ip, short port);
    bool send(const string& msg);
    bool recv(string& msg, const size_t& maxlen);
    void close();
    ~tcpClient();
};


#endif // __TCPCLIENT_H__
